/**
 * net event
 * Copyright (c) 2009 cmiscm.com
 * date of final modification : 2009. 07. 13 
*/
package com.cmiscm.net.events
{
	import flash.display.Bitmap;
	import flash.events.Event;
	
	/**
	 * Loader Event.
     * 
     */
	public class NetEvent extends Event
	{
		public static const COMPLETE:String = "complete";
		public static const PROGRESS:String = "progress";
		public static const ERROR:String = "error";
		public static const INITS:String = "inits";
		public static const SERVER_ERROR:String = "server_error";
		
		public static const NO_FILE:String = "no file";
		public static const TOTAL_ZERO:String = "total zero";
		public static const SECURITY_ERROR:String = "security error";
		public static const COMPLETE_ERROR:String = "complete error";
		public static const LOAD_ERROR:String = "load error";
		public static const PARSING_FAIL:String = "failed parsing";
		
		/**
		 * Load Percent 
		 */		
		public var percent:Number;
		
		/**
		 * Error Message 
		 */				
		public var message:String;
		
		/**
		 * AssetsLoader Content
		 */		
		public var content:Object;
		
		/**
		 * ImageLoader Content
		 */	
		public var bitmap:Bitmap;
		
		/**
		 * XmlLoader Content
		 */	
		public var xml:XML;
		
		public function NetEvent(type:String, $message:String=null, $percent:Number=0, $content:Object=null, $bitmap:Bitmap=null, $xml:XML=null, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
			this.percent = $percent;			
			this.message = $message;
			this.content = $content;
			this.bitmap = $bitmap;
			this.xml = $xml;
		}
		
		override public function clone():Event
		{
			return new NetEvent(this.type, this.message, this.percent, this.content, this.bitmap, this.xml, this.bubbles, this.cancelable);
		}
		
	}
}